class TFSuperweaponsMut extends Mutator config(SigGame);

var config string IonReplaceName;
var config string RedeemerReplaceName;
var config int LastIon, LastRedeemer;
var bool bInitialized;
var class<Weapon> IonReplaceClass;
var class<Weapon> RedeemerReplaceClass;

function Initialize()
{
	bInitialized = true;

	IonReplaceClass = class<Weapon>(DynamicLoadObject(IonReplaceName,class'Class'));
    RedeemerReplaceClass = class<Weapon>(DynamicLoadObject(RedeemerReplaceName,class'Class'));
}

function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
{
    if ( !bInitialized )
		Initialize();

	bSuperRelevant = 0;

    if ( xWeaponBase(Other) != None )
    {
		if(xWeaponBase(Other).weapontype==class'Redeemer') xWeaponBase(Other).WeaponType = RedeemerReplaceClass;
	    else if(xWeaponBase(Other).weapontype==class'Painter') xWeaponBase(Other).WeaponType = IonReplaceClass;
    }
    if ( Other.IsA('Redeemer') )
		ReplaceWith(Other, RedeemerReplaceName);
    else if ( Other.IsA('Painter') )
		ReplaceWith(Other, IonReplaceName);
    else return true;

	return false;
}

defaultproperties
{
     IonReplaceName="Taskforces.TFWBGun"
     RedeemerReplaceName="Taskforces.TFNKGun"
     ConfigMenuClassName="Taskforces.TFSWMutConfig"
     GroupName="Superweapons of Siege"
     FriendlyName="Superweapons of Siege"
     Description="Replace the standard superweapons with the new ones of Siege."
}
